package cn.stylefeng.guns.cp;

import cn.hutool.core.io.FileUtil;
import cn.stylefeng.guns.constant.Constant;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.compress.utils.Lists;

import java.nio.charset.Charset;
import java.util.List;

/**
 * @Description TODO
 * @Author xiesm
 * @Date 2024/3/11 10:51
 **/
public class SsqUtil {


    public static JSONObject getResult() {
        String token = Constant.json.getString("token");
        JSONObject ssq = ScUtil.sendSc(token, "39", "3", 0);
        return ssq;
    }

    public static List<Ssq> getSsqList(JSONObject data) {
        JSONArray array = data.getJSONArray("data");
        List<Ssq> ssqList = Lists.newArrayList();
        for (int i = 0; i < array.size(); i++) {
            JSONObject jsonObject = array.getJSONObject(i);
            ssqList.add(new Ssq(jsonObject.getString("code"), jsonObject.getString("issue")));
        }
        return ssqList;
    }

}
